package com.muapet.service;

import java.util.List;

import com.muapet.model.Order;
import com.muapet.model.other.AddressInfo;
import com.muapet.model.other.Pagination;
import com.muapet.model.other.sendInfo;

public interface IOrderService {
	/**
	 * 生成订单返回id
	 * 
	 * @param petId
	 * @param buyerId
	 * @return id|-1：已卖出|-2:不存在|-3:余额不足
	 */
	Integer addOrder(Integer petId, Integer buyerId, AddressInfo addressInfo);

	Order findById(Integer id);

	List<Order> findByOrderNo(String orderNo);

	List<Order> listOrdersByUserId(Integer userId);
	
	List<Order> listUndoOrdersByUserId(Integer userId);

	Integer pay(Integer id);

	Integer send(Integer id, sendInfo sendInfo);

	Integer receive(Integer id);

	List<Order> findAll(Pagination pagination);

	Integer countAll();
	
	Integer delete(Integer id);
}
